Manages the raster states available in the component. More...
Public Member Functions | |
| ~RasterStateManager () | |
| RasterState * | createOrRetrieve (const nkMemory::StringView &name) |
| RasterState * | get (const nkMemory::StringView &name) |
| RasterState * | getByIndex (unsigned int index) |
| void | rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName) |
| void | erase (const nkMemory::StringView &name) |
| RasterState * | getDefaultState () const |
Manages the raster states available in the component.
The manager owns the memory it allocates. External code should never free memory returned.
| nkGraphics::RasterStateManager::~RasterStateManager | ( | ) |
Destructor.
| RasterState* nkGraphics::RasterStateManager::createOrRetrieve | ( | const nkMemory::StringView & | name | ) |
Creates if unavailable, or retrieves if available, a state.
| name | The name of the state to retrieve. |
| RasterState* nkGraphics::RasterStateManager::get | ( | const nkMemory::StringView & | name | ) |
Retrieves a state.
| name | The name of the state to retrieve. |
| RasterState* nkGraphics::RasterStateManager::getByIndex | ( | unsigned int | index | ) |
Retrieves a state by index. Note that an index can map to different states as the internal memory is changed. Mainly used for looping over all states in one go.
| index | The index of the state to retrieve. |
| void nkGraphics::RasterStateManager::rename | ( | const nkMemory::StringView & | oldName, |
| const nkMemory::StringView & | newName | ||
| ) |
Renames a state, changing both its name and the way to address it in the manager.
| oldName | The name of the state to rename. |
| newName | The new name to attach to it. |
| void nkGraphics::RasterStateManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees the memory allocated for a state.
| name | The name of the state to erase. |
| RasterState* nkGraphics::RasterStateManager::getDefaultState | ( | ) | const |